//
//  SSBAlertView.m
//  tast
//
//  Created by 合事佬 on 2018/5/24.
//  Copyright © 2018年 合事佬. All rights reserved.
//

#import "SSBAlertView.h"
#import "ProgressHUD.h"
//#import "UIColor+Extension.h"

@implementation SSBAlertView

+ (instancetype)shareAlertView
{
    static id managerInstance = nil;
    static dispatch_once_t onceToken;
    dispatch_once(&onceToken, ^{
        managerInstance = [[[self class] alloc] init];
    });
    return managerInstance;
}

- (id)init
{
    self = [super init];
    if (self) {
    }
    return self;
}

#pragma mark - 提示窗
+ (void)showLoadingHUD:(NSString *)status statusFont:(int)statusFont statusColor:(NSString *)statusColor spinnerColor:(NSString *)spinnerColor interaction:(BOOL)interaction{
    statusFont == 0 ? [ProgressHUD statusFont:[UIFont systemFontOfSize:14]] : [ProgressHUD statusFont:[UIFont systemFontOfSize:statusFont]];
    
    /**
      接入组件库的颜色设置
    statusColor.length == 0 ? [ProgressHUD statusColor:[UIColor blackColor]] : [ProgressHUD statusColor:[UIColor colorWithHexString:statusColor]];
    spinnerColor.length == 0 ? [ProgressHUD spinnerColor:[UIColor lightGrayColor]] : [ProgressHUD spinnerColor:[UIColor colorWithHexString:spinnerColor]];
     
     **/
    status.length == 0 ?[ProgressHUD show] : [ProgressHUD show:status Interaction:interaction];
}

+ (void)showSuccessHUD:(NSString *)status statusFont:(int)statusFont statusColor:(NSString *)statusColor interaction:(BOOL)interaction imageSuccess:(NSString *)imageSuccess{
    
    statusFont == 0 ? [ProgressHUD statusFont:[UIFont systemFontOfSize:14]] : [ProgressHUD statusFont:[UIFont systemFontOfSize:statusFont]];
    /**
     接入组件库的颜色设置
    
    statusColor.length == 0 ? [ProgressHUD statusColor:[UIColor blackColor]] : [ProgressHUD statusColor:[UIColor colorWithHexString:statusColor]];
     **/
    imageSuccess.length == 0 ? [ProgressHUD imageSuccess:[UIImage imageNamed:@"ProgressHUD.bundle/success"]] : [ProgressHUD imageSuccess:[UIImage imageNamed:imageSuccess]];
    status.length == 0 ? [ProgressHUD showSuccess] : [ProgressHUD showSuccess:status Interaction:interaction];
}


+ (void)showErrorHUD:(NSString *)status statusFont:(int)statusFont statusColor:(NSString *)statusColor interaction:(BOOL)interaction imageError:(NSString *)imageError{
    
    statusFont == 0 ? [ProgressHUD statusFont:[UIFont systemFontOfSize:14]] : [ProgressHUD statusFont:[UIFont systemFontOfSize:statusFont]];
    
    /**
     接入组件库的颜色设置
    statusColor.length == 0 ? [ProgressHUD statusColor:[UIColor blackColor]] : [ProgressHUD statusColor:[UIColor colorWithHexString:statusColor]];
     **/
    imageError.length == 0 ? [ProgressHUD imageError:[UIImage imageNamed:@"ProgressHUD.bundle/error"]] : [ProgressHUD imageError:[UIImage imageNamed:imageError]];
    status.length == 0 ? [ProgressHUD showError] : [ProgressHUD showError:status Interaction:interaction];
}

//消除提示
+ (void)dismiss
{
    [ProgressHUD dismiss];
}

@end
